#ifndef DATABASE_H
#define DATABASE_H
#include<QtSql/QtSql>
class Database
{
    public:
        Database();
        void createTB(void);
// Insert
        void insertFA(QString);
        void insertFarm(QString name,QString address);
        void insertFamily(QString name,QString species,QString typecode,QString farmID);
        void insertFish(QString FamilyID,QString RFID,QString Sex);
        void insertBreader(QString FamilyID,QString FishID);
        void insertMeasurementFish(QString DeviceID,QString FishID,QString ImageID,QString Weight,QString StandardLength,QString TotalLength,QString HeadLength,QString BodyWidth,QString BodyDepth);
        void insertImage(QString ImagePath);
        void insertdevice(QString DeviceID,QString FarmID);
//Select
        QString selectFamily(void);
        QString selectImageIDFormImagePath(QString ImagePath);
        void selectMas(void);
        void selectNamefamily(void);
        void selectNamePond(void);
        QString selectFishIDFormRFID(QString RFID);
        QString selectFamilyIDFormFamilyname(QString Name);
        QString selectFarmIDformDeviceID(QString DeviceID);
        QString selectFarmIDformFarmname(QString Farmname);
        QString selectcountFamily(void);
        void close(void);
//ADD
        void AddFamily(QString name,QString Deviceid);
        void AddBreader(QString Familyname,QString RFID);
        void AddBreading(QString Familyname,QString RFID,QString sex);
        void AddFarm(QString Farmname,QString FarmAdd);
        void AddDeviceToFarm(QString DeviceID,QString FarmID);
        void AddMs(QString DeviceID,QString RFID,QString ImagePath,QString Weight, QString StandardLength,QString TotalLength,QString HeadLength,QString BodyWidth,QString BodyDepth);
    private:
        QSqlDatabase db;

};

#endif // DATABASE_H
